Option Explicit On 
Option Strict On
Imports System.Collections
Imports System.Collections.Specialized

Public Class frmProcessStep
    Inherits System.Windows.Forms.Form
    Public Shared bUpdate As Boolean
    Public Shared oCurProc As ProcessClass 'the Process Step being created or edited
    Private Shared intTimeStyle As Integer  'tells what format is in use for time
    Private Shared oPScontact As ContactInfo
    Friend WithEvents button_example As System.Windows.Forms.Button
    Dim dCurYear As Decimal


#Region " Windows Form Designer generated code "

    Public Sub New(ByVal InProc As ProcessClass)
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call
        oCurProc = InProc

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents Panel1 As System.Windows.Forms.Panel
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents txtDesc As System.Windows.Forms.TextBox
    Friend WithEvents ToolTip1 As System.Windows.Forms.ToolTip
    Friend WithEvents Panel2 As System.Windows.Forms.Panel
    Friend WithEvents cboxDay As System.Windows.Forms.ComboBox
    Friend WithEvents cboxMonth As System.Windows.Forms.ComboBox
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents Panel3 As System.Windows.Forms.Panel
    Friend WithEvents rdoDateCal As System.Windows.Forms.RadioButton
    Friend WithEvents rdoDateUnpub As System.Windows.Forms.RadioButton
    Friend WithEvents rdoDateUnk As System.Windows.Forms.RadioButton
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents txtUsed As System.Windows.Forms.TextBox
    Friend WithEvents txtProduced As System.Windows.Forms.TextBox
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents btnContact As System.Windows.Forms.Button
    Friend WithEvents txtMRcontact As System.Windows.Forms.TextBox
    Friend WithEvents Label20 As System.Windows.Forms.Label
    Friend WithEvents btnOK As System.Windows.Forms.Button
    Friend WithEvents btnCancel As System.Windows.Forms.Button
    Friend WithEvents cboxTimeDiff As System.Windows.Forms.ComboBox
    Friend WithEvents lblTdiff As System.Windows.Forms.Label
    Friend WithEvents txtTime As System.Windows.Forms.TextBox
    Friend WithEvents lblTime1 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents pnlTime As System.Windows.Forms.Panel
    Friend WithEvents numYear As System.Windows.Forms.NumericUpDown
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmProcessStep))
        Me.Panel1 = New System.Windows.Forms.Panel
        Me.button_example = New System.Windows.Forms.Button
        Me.pnlTime = New System.Windows.Forms.Panel
        Me.cboxTimeDiff = New System.Windows.Forms.ComboBox
        Me.lblTdiff = New System.Windows.Forms.Label
        Me.txtTime = New System.Windows.Forms.TextBox
        Me.lblTime1 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.btnCancel = New System.Windows.Forms.Button
        Me.btnOK = New System.Windows.Forms.Button
        Me.btnContact = New System.Windows.Forms.Button
        Me.txtMRcontact = New System.Windows.Forms.TextBox
        Me.Label20 = New System.Windows.Forms.Label
        Me.txtProduced = New System.Windows.Forms.TextBox
        Me.Label8 = New System.Windows.Forms.Label
        Me.txtUsed = New System.Windows.Forms.TextBox
        Me.Label4 = New System.Windows.Forms.Label
        Me.Panel2 = New System.Windows.Forms.Panel
        Me.numYear = New System.Windows.Forms.NumericUpDown
        Me.cboxDay = New System.Windows.Forms.ComboBox
        Me.cboxMonth = New System.Windows.Forms.ComboBox
        Me.Label7 = New System.Windows.Forms.Label
        Me.Label6 = New System.Windows.Forms.Label
        Me.Label5 = New System.Windows.Forms.Label
        Me.Panel3 = New System.Windows.Forms.Panel
        Me.rdoDateCal = New System.Windows.Forms.RadioButton
        Me.rdoDateUnpub = New System.Windows.Forms.RadioButton
        Me.rdoDateUnk = New System.Windows.Forms.RadioButton
        Me.Label2 = New System.Windows.Forms.Label
        Me.txtDesc = New System.Windows.Forms.TextBox
        Me.Label1 = New System.Windows.Forms.Label
        Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
        Me.Panel1.SuspendLayout()
        Me.pnlTime.SuspendLayout()
        Me.Panel2.SuspendLayout()
        CType(Me.numYear, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.Panel3.SuspendLayout()
        Me.SuspendLayout()
        '
        'Panel1
        '
        Me.Panel1.AutoScroll = True
        Me.Panel1.Controls.Add(Me.button_example)
        Me.Panel1.Controls.Add(Me.pnlTime)
        Me.Panel1.Controls.Add(Me.btnCancel)
        Me.Panel1.Controls.Add(Me.btnOK)
        Me.Panel1.Controls.Add(Me.btnContact)
        Me.Panel1.Controls.Add(Me.txtMRcontact)
        Me.Panel1.Controls.Add(Me.Label20)
        Me.Panel1.Controls.Add(Me.txtProduced)
        Me.Panel1.Controls.Add(Me.Label8)
        Me.Panel1.Controls.Add(Me.txtUsed)
        Me.Panel1.Controls.Add(Me.Label4)
        Me.Panel1.Controls.Add(Me.Panel2)
        Me.Panel1.Controls.Add(Me.Panel3)
        Me.Panel1.Controls.Add(Me.Label2)
        Me.Panel1.Controls.Add(Me.txtDesc)
        Me.Panel1.Controls.Add(Me.Label1)
        Me.Panel1.Location = New System.Drawing.Point(0, 0)
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(631, 461)
        Me.Panel1.TabIndex = 0
        Me.ToolTip1.SetToolTip(Me.Panel1, "information about a single event. ")
        '
        'button_example
        '
        Me.button_example.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.button_example.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.button_example.Image = Global.MetaDoc.My.Resources.Resources.app_help_48x48
        Me.button_example.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.button_example.Location = New System.Drawing.Point(511, 12)
        Me.button_example.Name = "button_example"
        Me.button_example.Size = New System.Drawing.Size(110, 48)
        Me.button_example.TabIndex = 21
        Me.button_example.Text = "EXAMPLE"
        Me.button_example.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        Me.button_example.UseVisualStyleBackColor = True
        '
        'pnlTime
        '
        Me.pnlTime.Controls.Add(Me.cboxTimeDiff)
        Me.pnlTime.Controls.Add(Me.lblTdiff)
        Me.pnlTime.Controls.Add(Me.txtTime)
        Me.pnlTime.Controls.Add(Me.lblTime1)
        Me.pnlTime.Controls.Add(Me.Label3)
        Me.pnlTime.Location = New System.Drawing.Point(311, 305)
        Me.pnlTime.Name = "pnlTime"
        Me.pnlTime.Size = New System.Drawing.Size(314, 119)
        Me.pnlTime.TabIndex = 12
        Me.ToolTip1.SetToolTip(Me.pnlTime, "the time when the event was completed. ")
        '
        'cboxTimeDiff
        '
        Me.cboxTimeDiff.Items.AddRange(New Object() {"-0500  Eastern Standard Time", "-0400  Eastern Daylight Time", "-0600  Central Standard Time", "-0500  Central Daylight Time", "-0700  Mountain Standard Time", "-0600  Mountain Daylight Time", "-0800  Pacific Standard Time", "-0700  Pacific Daylight Time", "-0900  Alaska", "-1000  Hawaii"})
        Me.cboxTimeDiff.Location = New System.Drawing.Point(94, 56)
        Me.cboxTimeDiff.MaxDropDownItems = 6
        Me.cboxTimeDiff.Name = "cboxTimeDiff"
        Me.cboxTimeDiff.Size = New System.Drawing.Size(208, 21)
        Me.cboxTimeDiff.TabIndex = 14
        Me.ToolTip1.SetToolTip(Me.cboxTimeDiff, "Time Differential")
        Me.cboxTimeDiff.Visible = False
        '
        'lblTdiff
        '
        Me.lblTdiff.Location = New System.Drawing.Point(8, 59)
        Me.lblTdiff.Name = "lblTdiff"
        Me.lblTdiff.Size = New System.Drawing.Size(100, 23)
        Me.lblTdiff.TabIndex = 22
        Me.lblTdiff.Text = "Time Differential:"
        Me.ToolTip1.SetToolTip(Me.lblTdiff, "Time Differential")
        Me.lblTdiff.Visible = False
        '
        'txtTime
        '
        Me.txtTime.Location = New System.Drawing.Point(144, 21)
        Me.txtTime.MaxLength = 6
        Me.txtTime.Name = "txtTime"
        Me.txtTime.Size = New System.Drawing.Size(88, 20)
        Me.txtTime.TabIndex = 13
        Me.ToolTip1.SetToolTip(Me.txtTime, "Time when process step was completed")
        '
        'lblTime1
        '
        Me.lblTime1.Location = New System.Drawing.Point(8, 26)
        Me.lblTime1.Name = "lblTime1"
        Me.lblTime1.Size = New System.Drawing.Size(168, 16)
        Me.lblTime1.TabIndex = 20
        Me.lblTime1.Text = "Universal Time (HHMMSS):"
        Me.ToolTip1.SetToolTip(Me.lblTime1, "Time when process step was completed")
        '
        'Label3
        '
        Me.Label3.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label3.Location = New System.Drawing.Point(8, 0)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(184, 16)
        Me.Label3.TabIndex = 19
        Me.Label3.Text = "Process Time (optional)"
        Me.ToolTip1.SetToolTip(Me.Label3, "the time when the event was completed. ")
        '
        'btnCancel
        '
        Me.btnCancel.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnCancel.Image = Global.MetaDoc.My.Resources.Resources.Cancel_16x16
        Me.btnCancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnCancel.Location = New System.Drawing.Point(550, 430)
        Me.btnCancel.Name = "btnCancel"
        Me.btnCancel.Size = New System.Drawing.Size(75, 23)
        Me.btnCancel.TabIndex = 16
        Me.btnCancel.Text = "Cancel"
        Me.btnCancel.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'btnOK
        '
        Me.btnOK.Enabled = False
        Me.btnOK.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnOK.Image = Global.MetaDoc.My.Resources.Resources.Ok_16x16
        Me.btnOK.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnOK.Location = New System.Drawing.Point(469, 430)
        Me.btnOK.Name = "btnOK"
        Me.btnOK.Size = New System.Drawing.Size(75, 23)
        Me.btnOK.TabIndex = 15
        Me.btnOK.Text = "OK"
        Me.btnOK.TextAlign = System.Drawing.ContentAlignment.MiddleRight
        '
        'btnContact
        '
        Me.btnContact.Image = Global.MetaDoc.My.Resources.Resources.file_edit_16x16
        Me.btnContact.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
        Me.btnContact.Location = New System.Drawing.Point(394, 277)
        Me.btnContact.Name = "btnContact"
        Me.btnContact.Size = New System.Drawing.Size(75, 23)
        Me.btnContact.TabIndex = 8
        Me.btnContact.Text = "Edit"
        '
        'txtMRcontact
        '
        Me.txtMRcontact.Location = New System.Drawing.Point(158, 279)
        Me.txtMRcontact.Name = "txtMRcontact"
        Me.txtMRcontact.ReadOnly = True
        Me.txtMRcontact.Size = New System.Drawing.Size(230, 20)
        Me.txtMRcontact.TabIndex = 7
        Me.txtMRcontact.TabStop = False
        Me.ToolTip1.SetToolTip(Me.txtMRcontact, "the party responsible for the processing step information. ")
        '
        'Label20
        '
        Me.Label20.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label20.Location = New System.Drawing.Point(16, 282)
        Me.Label20.Name = "Label20"
        Me.Label20.Size = New System.Drawing.Size(168, 23)
        Me.Label20.TabIndex = 6
        Me.Label20.Text = "Process Contact (optional)"
        Me.ToolTip1.SetToolTip(Me.Label20, "the party responsible for the processing step information. ")
        '
        'txtProduced
        '
        Me.txtProduced.Location = New System.Drawing.Point(19, 223)
        Me.txtProduced.Multiline = True
        Me.txtProduced.Name = "txtProduced"
        Me.txtProduced.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
        Me.txtProduced.Size = New System.Drawing.Size(450, 50)
        Me.txtProduced.TabIndex = 5
        Me.ToolTip1.SetToolTip(Me.txtProduced, resources.GetString("txtProduced.ToolTip"))
        '
        'Label8
        '
        Me.Label8.Location = New System.Drawing.Point(16, 208)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(240, 23)
        Me.Label8.TabIndex = 4
        Me.Label8.Text = "Source(s) Produced Citation Abbreviation(s)"
        Me.ToolTip1.SetToolTip(Me.Label8, resources.GetString("Label8.ToolTip"))
        '
        'txtUsed
        '
        Me.txtUsed.Location = New System.Drawing.Point(19, 154)
        Me.txtUsed.Multiline = True
        Me.txtUsed.Name = "txtUsed"
        Me.txtUsed.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
        Me.txtUsed.Size = New System.Drawing.Size(450, 50)
        Me.txtUsed.TabIndex = 3
        Me.ToolTip1.SetToolTip(Me.txtUsed, "the Source Citation Abbreviation of a data set used in the processing step.")
        '
        'Label4
        '
        Me.Label4.Location = New System.Drawing.Point(16, 139)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(216, 23)
        Me.Label4.TabIndex = 2
        Me.Label4.Text = "Source(s) Used Citation Abbreviation(s)"
        Me.ToolTip1.SetToolTip(Me.Label4, "the Source Citation Abbreviation of a data set used in the processing step.")
        '
        'Panel2
        '
        Me.Panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.Panel2.Controls.Add(Me.numYear)
        Me.Panel2.Controls.Add(Me.cboxDay)
        Me.Panel2.Controls.Add(Me.cboxMonth)
        Me.Panel2.Controls.Add(Me.Label7)
        Me.Panel2.Controls.Add(Me.Label6)
        Me.Panel2.Controls.Add(Me.Label5)
        Me.Panel2.Location = New System.Drawing.Point(145, 320)
        Me.Panel2.Name = "Panel2"
        Me.Panel2.Size = New System.Drawing.Size(160, 104)
        Me.Panel2.TabIndex = 11
        Me.Panel2.Visible = False
        '
        'numYear
        '
        Me.numYear.Location = New System.Drawing.Point(48, 8)
        Me.numYear.Maximum = New Decimal(New Integer() {2200, 0, 0, 0})
        Me.numYear.Minimum = New Decimal(New Integer() {1, 0, 0, 0})
        Me.numYear.Name = "numYear"
        Me.numYear.Size = New System.Drawing.Size(96, 20)
        Me.numYear.TabIndex = 3
        Me.numYear.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
        Me.numYear.Value = New Decimal(New Integer() {2004, 0, 0, 0})
        '
        'cboxDay
        '
        Me.cboxDay.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboxDay.Items.AddRange(New Object() {"00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"})
        Me.cboxDay.Location = New System.Drawing.Point(48, 72)
        Me.cboxDay.Name = "cboxDay"
        Me.cboxDay.Size = New System.Drawing.Size(96, 21)
        Me.cboxDay.TabIndex = 5
        Me.ToolTip1.SetToolTip(Me.cboxDay, "Optional")
        '
        'cboxMonth
        '
        Me.cboxMonth.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboxMonth.Items.AddRange(New Object() {"00 Unknown", "01 Jan", "02 Feb", "03 March", "04 April", "05 May", "06 June", "07 July", "08 August", "09 Sept", "10 Oct", "11 Nov", "12 Dec"})
        Me.cboxMonth.Location = New System.Drawing.Point(48, 40)
        Me.cboxMonth.Name = "cboxMonth"
        Me.cboxMonth.Size = New System.Drawing.Size(96, 21)
        Me.cboxMonth.TabIndex = 4
        Me.ToolTip1.SetToolTip(Me.cboxMonth, "Optional")
        '
        'Label7
        '
        Me.Label7.Location = New System.Drawing.Point(8, 75)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(48, 16)
        Me.Label7.TabIndex = 2
        Me.Label7.Text = "Day"
        '
        'Label6
        '
        Me.Label6.Location = New System.Drawing.Point(8, 43)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(48, 16)
        Me.Label6.TabIndex = 1
        Me.Label6.Text = "Month"
        '
        'Label5
        '
        Me.Label5.Location = New System.Drawing.Point(8, 10)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(40, 16)
        Me.Label5.TabIndex = 0
        Me.Label5.Text = "Year"
        '
        'Panel3
        '
        Me.Panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.Panel3.Controls.Add(Me.rdoDateCal)
        Me.Panel3.Controls.Add(Me.rdoDateUnpub)
        Me.Panel3.Controls.Add(Me.rdoDateUnk)
        Me.Panel3.Location = New System.Drawing.Point(19, 320)
        Me.Panel3.Name = "Panel3"
        Me.Panel3.Size = New System.Drawing.Size(120, 104)
        Me.Panel3.TabIndex = 10
        Me.ToolTip1.SetToolTip(Me.Panel3, " the date when the event was completed.")
        '
        'rdoDateCal
        '
        Me.rdoDateCal.Location = New System.Drawing.Point(8, 72)
        Me.rdoDateCal.Name = "rdoDateCal"
        Me.rdoDateCal.Size = New System.Drawing.Size(104, 24)
        Me.rdoDateCal.TabIndex = 2
        Me.rdoDateCal.Text = "Specify date"
        '
        'rdoDateUnpub
        '
        Me.rdoDateUnpub.Location = New System.Drawing.Point(8, 40)
        Me.rdoDateUnpub.Name = "rdoDateUnpub"
        Me.rdoDateUnpub.Size = New System.Drawing.Size(96, 24)
        Me.rdoDateUnpub.TabIndex = 1
        Me.rdoDateUnpub.Text = "Not complete"
        '
        'rdoDateUnk
        '
        Me.rdoDateUnk.Location = New System.Drawing.Point(8, 8)
        Me.rdoDateUnk.Name = "rdoDateUnk"
        Me.rdoDateUnk.Size = New System.Drawing.Size(80, 24)
        Me.rdoDateUnk.TabIndex = 0
        Me.rdoDateUnk.Text = "Unknown"
        '
        'Label2
        '
        Me.Label2.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label2.Location = New System.Drawing.Point(16, 305)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(112, 16)
        Me.Label2.TabIndex = 9
        Me.Label2.Text = "Process Date"
        Me.ToolTip1.SetToolTip(Me.Label2, " the date when the event was completed.")
        '
        'txtDesc
        '
        Me.txtDesc.Location = New System.Drawing.Point(19, 31)
        Me.txtDesc.Multiline = True
        Me.txtDesc.Name = "txtDesc"
        Me.txtDesc.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
        Me.txtDesc.Size = New System.Drawing.Size(450, 100)
        Me.txtDesc.TabIndex = 1
        Me.ToolTip1.SetToolTip(Me.txtDesc, "an explanation of the event and related parameters or tolerances.")
        '
        'Label1
        '
        Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label1.Location = New System.Drawing.Point(16, 14)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(128, 23)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "Process Description"
        Me.ToolTip1.SetToolTip(Me.Label1, "an explanation of the event and related parameters or tolerances.")
        '
        'ToolTip1
        '
        Me.ToolTip1.IsBalloon = True
        Me.ToolTip1.ShowAlways = True
        Me.ToolTip1.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info
        '
        'frmProcessStep
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(633, 462)
        Me.ControlBox = False
        Me.Controls.Add(Me.Panel1)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.Name = "frmProcessStep"
        Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Process Step"
        Me.ToolTip1.SetToolTip(Me, "information about a single event. ")
        Me.Panel1.ResumeLayout(False)
        Me.Panel1.PerformLayout()
        Me.pnlTime.ResumeLayout(False)
        Me.pnlTime.PerformLayout()
        Me.Panel2.ResumeLayout(False)
        CType(Me.numYear, System.ComponentModel.ISupportInitialize).EndInit()
        Me.Panel3.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub frmProcessStep_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim strDate As String = ""
        Dim intDate As Integer = 0
        Dim strYr As String = ""
        Dim strMth As String = ""
        Dim strMthCount As String = ""
        Dim strDay As String = ""
        Dim icount As Integer = 0  ' loop counter

        txtDesc.Text = oCurProc.Description 'fill the process description
        txtUsed.Text = oCurProc.UsedAbbrv 'fill the source used abbreviations
        txtProduced.Text = oCurProc.ProducedAbbrv 'fill the source produced abbreviations

        'fill in date and time info
        intTimeStyle = frmMetaMain.intTimeStyle
        rdoDateUnk.Checked = True
        If (oCurProc.ProcessDate = "Unknown") Then
            rdoDateUnk.Checked = True
            pnlTime.Visible = False
        ElseIf (oCurProc.ProcessDate = "Not complete") Then
            rdoDateUnpub.Checked = True
            pnlTime.Visible = False
        Else
            rdoDateCal.Checked = True
            strDate = oCurProc.ProcessDate
            intDate = Len(strDate)
            strYr = Microsoft.VisualBasic.Left(strDate, 4)
            numYear.Value = CType(strYr, Decimal)
            If (intDate > 4) Then  ' set Month combo box if known
                strMth = Mid(strDate, 5, 2)
                icount = cboxMonth.FindString(strMth)
                cboxMonth.SelectedIndex = icount
            End If
            If (intDate > 6) Then  ' set Day combo box if known
                strDay = Mid(strDate, 7, 2)
                icount = cboxDay.FindString(strDay)
                cboxDay.SelectedItem = icount
            End If
        End If

        'find current year, convert to integer; setting the Year combo box
        Dim dtYear As Date = Now
        Dim strCurYear As String = dtYear.ToString("yyyy")
        dCurYear = (CType(strCurYear, Decimal))
        If (strYr = "") Then
            'default year set to current year
            numYear.Value = dCurYear
        End If

        'set optional Process Time controls
        Dim strBaseTime As String = oCurProc.ProcessTime
        Dim strTimDiff As String = ""
        lblTdiff.Visible = False
        cboxTimeDiff.Visible = False

        If (intTimeStyle = 1) Then
            lblTime1.Text = "Local time (HHMMSS):"
            txtTime.Text = strBaseTime
        ElseIf (intTimeStyle = 2) Then
            lblTime1.Text = "Local time (HHMMSS):"
            If (Len(strBaseTime) > 0) Then
                icount = InStr(strBaseTime, "+")
                If (icount = 0) Then
                    icount = InStr(strBaseTime, "-")
                End If
                If (icount = 0) Then
                    txtTime.Text = ""
                Else
                    txtTime.Text = Microsoft.VisualBasic.Left(strBaseTime, icount - 1)
                    strTimDiff = Mid(strBaseTime, icount)
                End If
                intDate = cboxTimeDiff.FindString(strTimDiff)
                If (intDate = -1) Then
                    cboxTimeDiff.Items.Add(strTimDiff)
                    cboxTimeDiff.SelectedItem = strTimDiff
                Else
                    cboxTimeDiff.SelectedIndex = intDate
                End If
            End If
            lblTdiff.Visible = True
            cboxTimeDiff.Visible = True
        Else
            lblTime1.Text = "Universal Time (HHMMSS):"
            intDate = Len(strBaseTime)
            If (intDate > 0) Then
                txtTime.Text = Microsoft.VisualBasic.Left(strBaseTime, intDate - 1)
            Else
            End If
        End If

        'fill in the optional process contact field
        oPScontact = oCurProc.ProcessContact
        If (oPScontact.PrimaryPerson = True) Then
            txtMRcontact.Text = oPScontact.Person
        Else
            txtMRcontact.Text = oPScontact.Organization
        End If

    End Sub

    Public Function getUpdated() As Boolean
        Return bUpdate
    End Function

    Public Function getProcess() As ProcessClass
        Return oCurProc
    End Function

    Private Sub rdoDateCal_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rdoDateCal.CheckedChanged
        If (rdoDateCal.Checked = True) Then
            Panel2.Visible = True
            pnlTime.Visible = True
        Else
            Panel2.Visible = False
            pnlTime.Visible = False
            numYear.Value = dCurYear
            cboxMonth.SelectedIndex = -1
            cboxDay.SelectedIndex = -1
        End If
    End Sub

    Private Sub btnContact_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnContact.Click
        Dim iConType As Integer = 0
        Dim frmPStepcontact As frmContact
        If (txtMRcontact.Text = "") Then
            frmPStepcontact = New frmContact(oPScontact, 1)
        Else
            frmPStepcontact = New frmContact(oPScontact, 2)
        End If
        frmPStepcontact.ShowDialog()
        If frmPStepcontact.getUpdated() Then
            oPScontact = frmPStepcontact.getConInfo() 'update the contact object
            If (oPScontact.PrimaryPerson = True) Then 'update the form display
                txtMRcontact.Text = oPScontact.Person
            Else
                txtMRcontact.Text = oPScontact.Organization
            End If
        End If
    End Sub

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        If (txtDesc.Text = "") Then
            MessageBox.Show("The Process Step needs a description!", "Mandatory field absent", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Return
        End If
        oCurProc.Description = txtDesc.Text
        oCurProc.UsedAbbrv = txtUsed.Text

        'update process date
        Dim sYr As String = ""
        Dim sMonth As String = ""
        Dim sTime As String = ""
        Dim sDay As String = ""

        If (rdoDateUnk.Checked = True) Then
            oCurProc.ProcessDate = "Unknown"
        ElseIf (rdoDateUnpub.Checked = True) Then
            oCurProc.ProcessDate = "Not complete"
        Else
            sYr = numYear.Value.ToString
            sMonth = Microsoft.VisualBasic.Left(cboxMonth.Text, 2)
            If (sMonth = "00") Then
                sMonth = ""
            End If
            sDay = cboxDay.Text
            If (sDay = "00") Then
                sDay = ""
            End If
            sYr = sYr & sMonth & sDay
            oCurProc.ProcessDate = sYr
        End If

        'update process time (may be blank)
        sTime = txtTime.Text
        If (intTimeStyle = 1) Then
        ElseIf (intTimeStyle = 2) Then
            sDay = cboxTimeDiff.Text
            sTime = sTime & Microsoft.VisualBasic.Left(sDay, 5)
        Else
            sTime = sTime & "Z"
        End If
        oCurProc.ProcessTime = sTime

        'update remaining fields
        oCurProc.ProducedAbbrv = txtProduced.Text
        oCurProc.ProcessContact = oPScontact

        bUpdate = True
        Me.Close()
    End Sub

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        bUpdate = False
        Me.Close()
    End Sub

    Private Sub txtDesc_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtDesc.TextChanged
        If txtDesc.Text.Trim() = "" Then btnOK.Enabled = False Else btnOK.Enabled = True
    End Sub

    Private Sub button_example_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button_example.Click
        Dim helpForm As dialog_help = New dialog_help("ProcessStep")
        helpForm.ShowDialog()
    End Sub
End Class
